import service from '@/utils/request'

// @Tags LargeScaleOrder
// @Summary 创建大办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.LargeScaleOrder true "创建大办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /largeScaleOrder/createLargeScaleOrder [post]
export const createLargeScaleOrder = (data) => {
  return service({
    url: '/largeScaleOrder/createLargeScaleOrder',
    method: 'post',
    data
  })
}

// @Tags LargeScaleOrder
// @Summary 删除大办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.LargeScaleOrder true "删除大办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /largeScaleOrder/deleteLargeScaleOrder [delete]
export const deleteLargeScaleOrder = (params) => {
  return service({
    url: '/largeScaleOrder/deleteLargeScaleOrder',
    method: 'delete',
    params
  })
}

// @Tags LargeScaleOrder
// @Summary 批量删除大办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除大办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /largeScaleOrder/deleteLargeScaleOrder [delete]
export const deleteLargeScaleOrderByIds = (params) => {
  return service({
    url: '/largeScaleOrder/deleteLargeScaleOrderByIds',
    method: 'delete',
    params
  })
}

// @Tags LargeScaleOrder
// @Summary 更新大办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.LargeScaleOrder true "更新大办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /largeScaleOrder/updateLargeScaleOrder [put]
export const updateLargeScaleOrder = (data) => {
  return service({
    url: '/largeScaleOrder/updateLargeScaleOrder',
    method: 'put',
    data
  })
}

// @Tags LargeScaleOrder
// @Summary 用id查询大办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.LargeScaleOrder true "用id查询大办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /largeScaleOrder/findLargeScaleOrder [get]
export const findLargeScaleOrder = (params) => {
  const { version } = params;
  return service({
    url: version ? '/largeScaleOrder/getLargeScaleOrderHistory': `/largeScaleOrder/findLargeScaleOrder`,
    method: 'get',
    params
  })
}

// @Tags LargeScaleOrder
// @Summary 分页获取大办单列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取大办单列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /largeScaleOrder/getLargeScaleOrderList [get]
export const getLargeScaleOrderList = (params) => {
  return service({
    url: '/largeScaleOrder/getLargeScaleOrderList',
    method: 'get',
    params
  })
}

export const largeScaleOrderMoldHouseList = (params) => {
  return service({
    url: '/largeScaleOrderMoldHouse/getLargeScaleOrderMoldHouseList',
    method: 'get',
    params
  })
}

export const createLargeScaleOrderMoldHouse = (data) => {
  return service({
    url: '/largeScaleOrderMoldHouse/createLargeScaleOrderMoldHouse',
    method: 'post',
    data
  })
}

export const updateLargeScaleOrderMoldHouse = (data) => {
  return service({
    url: '/largeScaleOrderMoldHouse/updateLargeScaleOrderMoldHouse',
    method: 'put',
    data
  })
}

export const firstOrderProcessingListByStyleNum = (params) => {
  return service({
    url: '/firstOrderProcessing/getFirstOrderProcessingListByStyleNum',
    method: 'get',
    params
  })
}

export const updateLargeScaleOrderStatus = (data) => {
  return service({
    url: '/largeScaleOrder/updateLargeScaleOrderStatus',
    method: 'put',
    data
  })
}

export const largeScaleOrderPrint = (params) => {
  return service({
    url: '/largeScaleOrder/print',
    method: 'get',
    params
  })
}

export const largeScaleOrderExportMaterialList = (params) => {
  return service({
    url: '/largeScaleOrder/export',
    method: 'get',
    params
  })
}

// 查与上版本配件对比数据
export const versionComparison = (params) => {
  return service({
    url: '/largeScaleOrder/versionComparison',
    method: 'get',
    params
  })
}

// 客户确认时间
export const customerConfirmLargeScaleOrderTime = (data) => {
  return service({
    url: '/largeScaleOrder/verifyLargeScaleOrder',
    method: 'put',
    data
  })
}

// 客户确认时间
export const updateProductionDepartment = (data) => {
  return service({
    url: 'largeScaleOrder/updateProductionDepartment',
    method: 'post',
    data
  })
}

/**
 * 获取历史版本
 * @param {*} params 
 * @returns 
 */
export const getLargeScaleOrderHistoryList = (params) => {
  return service({
    url: '/largeScaleOrder/getLargeScaleOrderHistoryList',
    method: 'get',
    params
  })
}